/* eslint-disable max-classes-per-file */
/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-08-02 13:36:58
 * @LastEditors: wiz
 * @LastEditTime: 2024-05-05 11:59:59
 */
import Vue from 'vue';

import { ifs } from '@/types';
import { ColumnInfo, RenderOptions } from 'vxe-table';

namespace N_input {
  export interface I_multiOption {
    key: string;
    label: string;
    border: boolean;
    icon: string;
  }
  export interface I_renderOpts extends RenderOptions {
    attrs: object;
    autoselect: boolean;
    events: { [fnName: string]: () => void }; // 事件回调
    name: string; // 组件名
    props: {
      disabled: boolean; // 默认显示状态
      funName: string; // 功能名
      size: string; // 组件尺寸
      getTcommand: () => any;
      multiOptions?: Array<I_multiOption>; // 是否多选
    };
  }
  export interface I_baseGridParams {
    $columnIndex: number;
    $grid: any;
    $rowIndex: number;
    $table: any;
    $type: string;
    column: ColumnInfo;
    columnIndex: number;
    data: Array<any>;
    fined: boolean;
    isHidden: boolean;
    items: Array<any>;
    level: number;
    row: object;
    rowIndex: number;
    rowid: string; // vxe-table rowid 例 row_13
    seq: number;
    type: string; // body
    visibleData: Array<any>;
    _columnIndex: number;
    _rowIndex: number;
  }
  export interface I_fileDesc {
    _content_: 'image' | 'file'; // 识别此json内容是什么内容
    fileName: string; // 文件名
    libFileName: string; // 库文件名
  }
  export interface I_fileValue {
    fileLibID: string; // 文件库ID
    files: Array<I_fileDesc>;
  }
  export interface I_componentProps {
    oControl: any;
    renderOpts: I_renderOpts;
    params: any;
    config: any;
  }
  export interface I_oColtrolVal extends ifs.I_compCfg {}
  // 所有input组件的公共需求方法
  interface I_inputPubFun extends Vue {
    /**
     * 手动聚焦输入框
     */
    focus(): void;

    /**
     * 重置为空
     */
    resetValue(): void;

    /**
     * 设置值
     * @param val @default undefined 值
     */
    setValue(val?: any): void;
    /**
     * 获取值
     *
     */
    getValue(): any;
  }
  export interface oDatePicker extends I_inputPubFun {}
  export interface oI18nSelector extends I_inputPubFun {}
  export interface oInput extends I_inputPubFun {}
  export interface oM2oSelector extends I_inputPubFun {}
  export interface oNumberInput extends I_inputPubFun {}
  export interface oNumberInputRange extends I_inputPubFun {}
  export interface oSelect extends I_inputPubFun {}
  export interface oSwitch extends I_inputPubFun {}
  export interface oAttachment extends I_inputPubFun {}
  export interface oAttachmentCell extends I_inputPubFun {}
  export interface oControl extends I_inputPubFun {
    componentProps: I_componentProps;
  }
  export interface oSearch extends I_inputPubFun {}
}

export { N_input };
